package com.ruoyi.nongjt.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.nongjt.domain.CertificatePrint;
import com.ruoyi.nongjt.mapper.CertificatePrintMapper;
import com.ruoyi.nongjt.service.CertificatePrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 合格证打印Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
@Service
public class CertificatePrintServiceImpl implements CertificatePrintService 
{
    @Autowired
    private CertificatePrintMapper certificatePrintMapper;

    /**
     * 查询合格证打印
     * 
     * @param id 合格证打印主键
     * @return 合格证打印
     */
    @Override
    public CertificatePrint selectCertificatePrintById(Long id)
    {
        return certificatePrintMapper.selectCertificatePrintById(id);
    }

    /**
     * 查询合格证打印列表
     * 
     * @param certificatePrint 合格证打印
     * @return 合格证打印
     */
    @Override
    public List<CertificatePrint> selectCertificatePrintList(CertificatePrint certificatePrint)
    {
        return certificatePrintMapper.selectCertificatePrintList(certificatePrint);
    }

    /**
     * 新增合格证打印
     * 
     * @param certificatePrint 合格证打印
     * @return 结果
     */
    @Override
    public int insertCertificatePrint(CertificatePrint certificatePrint)
    {
        certificatePrint.setCreateTime(DateUtils.getNowDate());
        return certificatePrintMapper.insertCertificatePrint(certificatePrint);
    }

    /**
     * 修改合格证打印
     * 
     * @param certificatePrint 合格证打印
     * @return 结果
     */
    @Override
    public int updateCertificatePrint(CertificatePrint certificatePrint)
    {
        certificatePrint.setUpdateTime(DateUtils.getNowDate());
        return certificatePrintMapper.updateCertificatePrint(certificatePrint);
    }

    /**
     * 批量删除合格证打印
     * 
     * @param ids 需要删除的合格证打印主键
     * @return 结果
     */
    @Override
    public int deleteCertificatePrintByIds(Long[] ids)
    {
        return certificatePrintMapper.deleteCertificatePrintByIds(ids);
    }

    /**
     * 删除合格证打印信息
     * 
     * @param id 合格证打印主键
     * @return 结果
     */
    @Override
    public int deleteCertificatePrintById(Long id)
    {
        return certificatePrintMapper.deleteCertificatePrintById(id);
    }

    /**
     * 逻辑删除合格证打印
     * 
     * @param id 合格证打印主键
     * @return 结果
     */
    @Override
    public int logicDeleteCertificatePrintById(Long id)
    {
        return certificatePrintMapper.logicDeleteCertificatePrintById(id);
    }

    /**
     * 批量逻辑删除合格证打印
     * 
     * @param ids 需要删除的合格证打印主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteCertificatePrintByIds(Long[] ids)
    {
        return certificatePrintMapper.logicDeleteCertificatePrintByIds(ids);
    }
}
